    <?php 
		
			$sec_id = "top-dig";
			$nav_class = "menu-dig";
			$body_class = "body-dig";
			if($home)
				$conf->style['background'] = "background:url(assets/images/pt-bg.png);";
	?>

<body style='<?PHP echo $conf->style['background'];?>' class="<?php echo $body_class; ?>">

	<div class='ad-leaderboard'>
		<div class='ad-leaderboard-img'>
                	<?PHP
					if($conf->advertise)
					{
                		include 'assets/ads/adsense-leader.php';
					}
                		?>

		</div>
        </div>
	<section id='<?php echo $sec_id; ?>'>
	
		<div id='nav-holder' class='body'>	
			<h3><a href=''>
			<img src="assets/images/ptt-logo-mini.png" alt="Ptt Logo Mini">
				</a> <span id='nav-beta'>Beta</span></h3>
			<nav>
			
			
			
					<?PHP
					include 'admin/m/pt/menu.php';
				
					?>
			

				    <div id="fb-root"></div>
					<script>
				      window.fbAsyncInit = function() {
				        FB.init({
				          appId   	: '<?php echo $auth_session->fb["appId"];?>',
				          session 	: <?php echo json_encode($auth_session->fb["session"]); ?>, // don't refetch the session when PHP already has it
				          status  	: true, // check login status
				          cookie  	: true, // enable cookies to allow the server to access the session
				          xfbml   	: true // parse XFBML
				        });

				        // whenever the user logs in, we refresh the page
				        FB.Event.subscribe('auth.login', function() {
				          window.location.reload();
				        });
				      };

				      (function() {
				        var e = document.createElement('script');
				        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
				        e.async = true;
				        document.getElementById('fb-root').appendChild(e);
				      }());
				    </script>
					<?php if ($auth_session->fb["me"]){ ?>
					Welcome <?php echo $_SESSION['user_name']; ?><br />
				    <li><a href="<?php echo $auth_session->fb["logoutUrl"]; ?>">
							Logout
				    </a></li>
				    <?php 
						}
						else{ 
						if (empty($_SESSION['user_level'])){
					?>
				    
					<li> or&nbsp;	<fb:login-button perms="email,user_hometown,publish_stream" ></fb:login-button></li>
				    
				  
				    <?php 
					}
					} ?>
					
					<div id="pt-login">
					<?php if(empty($_SESSION['user_level'])){?>
						<input class="user-name-init" type="text" name="user_name" id="user_name" value="username" />
						<input class="user-name-init" type="text" name="user_password_front" id="user_password_front" value="password" />
						<input type="password" name="user_password" id="user_password" />
						<input type="button" name="submit_button" id="submit_button" value="login" />	
						<p>Not a member of Pinoytuner? <a href="signup/new-user">Sign Up</a></p>	
						
					<?php }
					else{
					?>	
						<p style='float:right; margin-top:-3px; margin-right:10px;'>
							Welcome <?php echo $_SESSION['user_name']; ?> |
							<a style="cursor:pointer" type="button" name="logout_button" id="logout_button" >Logout</a> |
							<a href='signup/change-password'>Change Password</a>
						</p>
						
					<?php }?>
					</div>
				</nav>
			</div>
			
		
	</section>
	
	<section id='top-nav' class='body <?php echo $nav_class; ?>'>
			<div id="top-nav-menu" >
				<ul id='menu' style="float:left">

					<?PHP 
				
					foreach($header_dropdown as $z)
					{
						if($z['menu']=='enabled')
						{
						?>
								<li id='dropdown-<?PHP echo $z["id"];?>' class='header-dropdown-list'>
									<span class='header-dropdown-parent'><?PHP echo $z["name"];?></span>
									<ul id='' class='dropdown-<?PHP echo $z["id"];?> header-dropdown-item'>
										<?PHP
										foreach($z['child'] as $y)
										{
											?>
												<a href='community/<?PHP echo $y["id"];?>/<?PHP echo csq($y["name"]);?>'>
													<li>
														<h1><?PHP echo $y["name"];?></h1>
														<?PHP echo $y["description"];?>
													</li>
												</a>
											<?PHP
										}

										?>


									</ul>
								</li>

						<?PHP
						}
					}
					?>


				</ul>
				
			</div>
			<script type="text/javascript" charset="utf-8">
				
				$("#user_password").hide();
				
				$("#menu li ul").hide(); 

					$("#menu li").hover(
				        function () {
						$(this).children("ul").fadeIn(100);
				        },function(){
						$(this).children("ul").fadeOut(100);
					});//hover
					
					$("#user_name").focus(
						function(){
						if($(this).val()=='username' && $(this).hasClass("user-name-init")){
							$(this).val("");
							$(this).removeClass("user-name-init");
						}
					});
					$("#user_password_front").focus(
						function(){
						if($(this).val()=='password' && $(this).hasClass("user-name-init")){
							$(this).hide();
							$("#user_password").show();
							$("#user_password").focus();
						}
					});
					$("#user_password").blur(
						function(){
						if($(this).val()==''){
							$(this).hide();
							$("#user_password_front").show();
							$("#user_password").hide();
						}
					});
					$("#user_name").blur(
						function(){
						if($(this).val()==''){
							$(this).val("username");
							$(this).addClass("user-name-init");
						}
					});
					$("#submit_button").click(
						function(){
							if($("#user_name").val()=="" || $("#user_name").val()=="username")
							{
								alert("username cannot be blank");
							}
							else
							{
								var uname = $("#user_name").val();
								var pwd = $("#user_password").val();
								
								$.ajax({
								type: "POST",
								url: "a/process-login.php",
								data: {'user_name':uname,'user_password':pwd},
								dataType: "json",
								success: function(data) 
								{
									
									if(data.success==1)
									{
									$("#user_name").hide();
									$("#user_password").hide();
									$("#submit_button").hide();
									document.location.href = "<?php echo $_SERVER['REQUEST_URI']; ?>";
											
									}
									else
									{
									alert(data.message);
									}
								}
								});
			
							}
					});
					$("#logout_button").click(function(){
						$.ajax({
								type: "POST",
								url: "a/process-login.php",
								data: {'function':'logout'},
								dataType: "json",
								success: function(data) 
								{
									$("#user_name").show();
									$("#user_password_front").show();
									$("#submit_button").show();
									document.location.href = "";
								}
								});
					});
			</script>
			<div id='header-social'>
			
				<?PHP
				if($conf->advertise)
				{
					if($home)
					{
						$linkfb = "http://www.facebook.com/pinoytuner";
						$linktweet = "http://twitter.com/pinoytuner";
					}
					else{
						switch($conf->qm[1])
						{
							case 18: 
								$linkfb = "http://www.facebook.com/digradio";
								$linktweet = "http://twitter.com/digradioph";
								break;
							case 21: 
								$linkfb = "http://www.facebook.com/VSO99.5RT";
								
								break;
							case 22:
								$linkfb = "http://www.facebook.com/pages/JAZZistas/128063037209962";
								break;
							default:
								$linkfb = "http://www.facebook.com/digradio";
								$linktweet = "http://twitter.com/digradioph";
						}
					}
					echo 
					"<span class='hs-text'>like/follow us to recieve priority access
						<img src='assets/images/pt-arrow-home.png'>
					</span>";
					echo "<a target='_blank' href=$linkfb><img src='assets/images/fb-round.png'></a>";
					if(!empty($linktweet))
            		{
						echo "<a target='_blank' href=$linktweet><img src='assets/images/tweet-round.png'></a>";
					}
				}
            		?>
						

		
			</div>
		
	</section>
	<?PHP

    
	if(!$home && $conf->qm[0]!='signup')
	{
		
		if($conf->qm[0]=='community')
		    $url_parent = $conf->qm[0]."/".$conf->qm[1];
		else
			$url_parent = "community/".$parent['id'];
	     
		?>
		<section id='masthead' class='body'>
			<h1 style='<?PHP echo $conf->style['custom_masthead'];?>'>
			
				<a href="<?php echo $url_parent; ?>" style="color:#fff"><?PHP echo $conf->style['masthead'];?></a>
			
			
			
			</h1> 
		<div id='play_button' >
		<div id="search-box">
				<form name="search" action="search/18" method="get">
					<input id='search-text' class='text' type='text' name='search'>
					<input class='button' type='submit' value='GO'>
				</form>
			</div>
			<?php if(!empty($todayshow)) {?>
					<a href="play/<?PHP echo $todayshow['id'];?>/<?PHP echo csq($todayshow['title']);?>" class="popoutplayer c-box-latest-link">
					<img class="firstbutton" src="assets/images/liveshow.png" alt="Launch Player">
					</a>
				<?php	}
				else{
				?>
					<a href="play/500/<?PHP echo csq("default");?>" class="popoutplayer c-box-latest-link">
					<img class="firstbutton" src="assets/images/liveshow.png" alt="Launch Player">
					</a>
				<?php				
				}
				?>
			<a href="play/<?PHP echo $latest_video['id'];?>/<?PHP echo csq($latest_video['title']);?>" class="popoutplayer c-box-latest-link">
				<img src="assets/images/playlist.png" alt="Launch Player">
				</a>
				
		
			</div>
		</section>
		<script type="text/javascript" charset="utf-8">
		$('body').ready(function() {
			$('#search-text').focus(function() {
			$(this).css({background:'#FFFFFF'});
		});

		$('#search-text').blur(function() {
			if ($(this).val() == '') {
            $(this).css({background:'url("assets/images/search.png") no-repeat scroll 7px 5px #FFFFFF'});
        };
		});
});
		</script>

		<?PHP
	}
	else
	{
		?>

		
		<?PHP
	}
	?>
	<section id='messages' class='body'>
	
		
		<?PHP $conf->print_messages();?>
	</section>
	<?php if($conf->qm[1]==18 || $parent['id']==18){ ?>
		<section id="dig-mid-nav">
			
			<ul>
				<?php
				 if($conf->qm[0]=="community")				 
					echo "<li class='dig-active-page'>";
				 else
					echo "<li>";
				?>
				
				
					<a href="community/18">dig</a>
				</li>
				<?php
				if($conf->qm[0]=="newsview")				 
					echo "<li class='dig-active-page element'>";
				 else
					echo "<li class='element'>";
				?>
				
					<a href="newsview/18">news</a>
				</li>
				<?php
				if($conf->qm[0]=="features")				 
					echo "<li class='dig-active-page element'>";
				 else
					echo "<li class='element'>";
				?>
					<a href="features/18">features</a>
				</li >
				<?php
				if($conf->qm[0]=="reviewview")				 
					echo "<li class='dig-active-page element'>";
				 else
					echo "<li class='element'>";
				?>
					<a href="reviewview/18">reviews</a>
				</li >
				<?php
				if($conf->qm[0]=="blogview")				 
					echo "<li class='dig-active-page element'>";
				 else
					echo "<li class='element'>";
				?>
					<a href="blogview/18">blogs</a>
				</li>
				<?php
				if($conf->qm[0]=="gallery_view")				 
					echo "<li class='dig-active-page element last-link'>";
				 else
					echo "<li class='element last-link'>";
				?>
					<a href="gallery_view/18">galleries</a>
				</li>
			</ul>
			
		</section>
	
<?php }?>